package com.zretc.service.impl;

import com.zretc.dao.AccountDao;
import com.zretc.dao.impl.AccountDaoImpl;
import com.zretc.entity.Account;
import com.zretc.service.AccountService;

public class AccountServiceImpl implements AccountService{
	private AccountDao accountDao = new AccountDaoImpl();
	@Override
	public int register(Account account) {
		return accountDao.insert(account);
	}

	@Override
	public boolean existsOfAccountTel(String accountTel) {
		Account findByAccountName = accountDao.findByAccountTel(accountTel);

		return findByAccountName != null ? true : false;
	}

	@Override
	public Account login(String accountTel, String accountPwd) {
		return accountDao.findByAccountTelAndPwd(accountTel, accountPwd);
	}

}





